//
//  FPCruxCollectionViewCell.m
//  FilmParadise
//
//  Created by lanou3g on 15/7/20.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//

#import "FPCruxCollectionViewCell.h"
#define imageWidth (kScreenWidth - 30) / 3

@implementation FPCruxCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        // 日期
        self.dateLabel = [UILabel labelWithFrame:CGRectMake(kImageW(15), 0, kImageW(70), kImageH(20)) text:@"07月17日" fontSize:12.0 fontWeight:1.0 color:[UIColor colorWithWhite:0.792 alpha:1.000]];
        [self.contentView addSubview:_dateLabel];
        
        // 分割线
        UIView *sepView = [[UIView alloc] initWithFrame:CGRectMake(kImageW(70), kImageH(10), kImageW(kScreenWidth - 70), kImageH(1))];
        sepView.backgroundColor =[UIColor colorWithWhite:0.792 alpha:1.000];
        [self.contentView addSubview:sepView];
        
        // 影片海报
        self.displayImageView = [UIImageView imageViewWithframe:CGRectMake(kImageW(15), kImageH(20), kImageW((kScreenWidth - 30) / 4), kImageH((kScreenHeight - 100) / 3.5 - 30)) imageName:@"idea-vector" cornerRadius:0 bordeWidth:0 backgroundColor:[UIColor whiteColor]];
        [self.contentView addSubview:_displayImageView];
        
        // 影片名
        self.filmNameLabel = [UILabel labelWithFrame:CGRectMake(kImageW(imageWidth ), kImageH(20), kImageW(200), kImageH(30)) text:@"煎饼侠" fontSize:18.0 fontWeight:2.0 color:[UIColor blackColor]];
        [self.contentView addSubview:_filmNameLabel];
        
        // 想观看的人数
        self.wantedCountLabel = [UILabel labelWithFrame:CGRectMake(kImageW(imageWidth ), kImageH(50), kImageW(50), kImageH(10)) text:@"6666" fontSize:12.0 fontWeight:1.0 color:[UIColor orangeColor]];
        [self.contentView addSubview:_wantedCountLabel];
        
        // 想看人数标签
        UILabel *peopleLabel = [UILabel labelWithFrame:CGRectMake(kImageW(imageWidth + 30), kImageH(50), kImageW(70), kImageH(10)) text:@"人想看 - " fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
        [self.contentView addSubview:peopleLabel];
        
        // 影片类型
        self.typeLabel = [UILabel labelWithFrame:CGRectMake(kImageW(imageWidth + 80), kImageH(50), kImageW(100), kImageH(10)) text:@"喜剧" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
        [self.contentView addSubview:_typeLabel];
        
        // 导演和演员标签
        UILabel *label1 = [UILabel labelWithFrame:CGRectMake(kImageW(imageWidth ), kImageH(70), kImageW(30), kImageH(10)) text:@"导演:" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
        [self.contentView addSubview:label1];
        
        UILabel *label2 = [UILabel labelWithFrame:CGRectMake(kImageW(imageWidth ), kImageH(90), kImageW(30), kImageH(10)) text:@"演员:" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
        [self.contentView addSubview:label2];
        
        // 导演
        self.directLabel = [UILabel labelWithFrame:CGRectMake(kImageW(imageWidth + 30), kImageH(70), kImageW(100), kImageH(10)) text:@"董成鹏" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
        [self.contentView addSubview:_directLabel];
        
        // 演员
        self.actorLabel = [UILabel labelWithFrame:CGRectMake(kImageW(imageWidth + 30), kImageH(90), kImageW(100), kImageH(10)) text:@"董成鹏/袁珊珊" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
        [self.contentView addSubview:_actorLabel];
        
        // 超前预售/上映提醒
        self.aheadShopButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.aheadShopButton.frame = CGRectMake(kImageW(imageWidth ), kImageH(120), kImageW(kScreenWidth / 4), kImageH(30));
        [self.aheadShopButton setTitle:@"超前预售" forState:UIControlStateNormal];
        self.aheadShopButton.backgroundColor = [UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000];
        [self.aheadShopButton setTintColor:[UIColor whiteColor]];
        self.aheadShopButton.layer.cornerRadius = kImageH(15);
        self.aheadShopButton.layer.borderColor = [UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000].CGColor;
        self.aheadShopButton.layer.borderWidth = 1.0;
        self.aheadShopButton.layer.masksToBounds = YES;
        [self.contentView addSubview:_aheadShopButton];
        
        //预告片
        self.trailerButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.trailerButton.frame = CGRectMake(kImageW(imageWidth + 10 + kScreenWidth / 4), kImageH(120), kImageW(kScreenWidth / 4), kImageH(kImageH(30)));
        [self.trailerButton setTitle:@"预告片" forState:UIControlStateNormal];
        self.trailerButton.backgroundColor = [UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000];
        [self.trailerButton setTintColor:[UIColor whiteColor]];
        self.trailerButton.layer.borderColor = [UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000].CGColor;
        self.trailerButton.layer.borderWidth = 1.0;
        self.trailerButton.layer.cornerRadius = kImageH(15);
        self.trailerButton.layer.masksToBounds = YES;
        [self.contentView addSubview:_trailerButton];

    }
    return self;
}
/* 本页面所有控件
 UIScrollView *self.contentView;// 滑动视图
 
 UILabel *titleLabel;       // 顶部标题
 UILabel *dateLabel;        // 日期
 UILabel *filmNameLabel;    // 影片名
 UILabel *wantedCountLabel; // 想看人数
 UILabel *typeLabel;        // 影片类型
 UILabel *directLabel;      // 导演
 UILabel *actorLabel;       // 演员
 UIButton *aheadShopButton; // 超前预售/上映提醒
 UIButton *trailerButton;   // 预告片
 UIImageView *displayImageView; // 影片海报
 */

@end
